{% extends 'admins/base.html' %}
{% block link %}
    <link rel="stylesheet" href="/static/editormd/css/editormd.css"/>
    <link rel="stylesheet" href="/static/dist/css/AdminLTE.css">
{% endblock %}
{% block body %}

<section class="content-header">
            <h1>
                编辑博主信息
            </h1>
        </section>
        <section class="content">
            <div class="row">
                <form action="{% url 'adminabout' %}" method="post">
                    {% csrf_token %}
                    <div class="col-md-12">
                        <div id="layout">
                            <div id="editormd"></div>
                        </div>
                    </div>
                    <div class="box-footer" style="background-color: #ecf0f5">
                        <button type="submit" class="btn btn-primary pull-right btn-lg">保存</button>
                    </div>
                </form>
            </div>
        </section>
{% endblock %}

{% block javascript %}
    <script type="text/javascript">
			$(document).ready(function(){
				$('#about').addClass("active");
                $("body").addClass("sidebar-collapse");
		});
    </script>
    <script src="/static/editormd/editormd.js"></script>
    <script type="text/javascript">
        var Editor;
        $(function () {
            $.get('{% url 'getabout' %}', function (md) {
                Editor = editormd("editormd", {
                    width: "100%",
                    height: 740,
                    path: '/static/editormd/lib/',
                    markdown: md,
                    codeFold: true,
                    saveHTMLToTextarea: true,
                    searchReplace: true,
                    htmlDecode: "style,script,iframe|on*",
                    emoji: true,
                    taskList: true,
                    tocm: true,
                    tex: true,
                    flowChart: true,
                    sequenceDiagram: true,
                    imageUpload: true,
                    imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                    imageUploadURL: "/admins/upload/"
                });
            });
        });
    </script>
{% endblock %}
